<template>
    <!--建档资料维护模块   基本资料页面-->
    <div class="fillcontain bgfff baseInfo editInput">
        <!-- 表单 -->
        <el-form :rules="rules" label-width="130px" class="search_container" v-if="euaa">
                <el-row>
                    <el-col :span="6">
                        <el-form-item label="受理号码" prop="acceptNo">
                            <el-input v-model="euaa.applnum"  disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="首期缴费方式" prop="flag10">
                            <el-select v-model="euaa.flag10" :disabled="flag =='N'"  @change="checkFlag10">
                                <el-option
                                    v-for="item in flag10s"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="销售渠道" prop="srcebusAsSrc">
                            <el-row>
                                <el-col :span="12">
                                    <el-input v-model="euaa.srcebus" :disabled="flag =='N'" @change="checkSrcebus"></el-input>
                                </el-col>
                                <el-col :span="12">
                                    <el-input class="ml5" :disabled="flag =='N'" v-model="euaa.asSrc"></el-input>
                                </el-col>
                            </el-row>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="承办人员" prop="">
                            <el-input v-model = "euaa.as_user_1" disabled ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="投保日" prop="appldate">
                            <el-input v-model="euaa.appldate" ref="appldate" :disabled="flag =='N'||euaa.riskType=='转投保'||euaa.riskType=='续保'" @change="checkAsAppldate" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="收款凭证" prop="wnotnum">
                            <el-col :span="16"><el-input v-model="euaa.asWnotnum" disabled :readonly="euaa_asWnotnum_readonly"
                                @change="checkAsWnotnum" :maxlength="9" ></el-input></el-col>
                            <el-col :span="8" style="padding-left:5px!important;">
                                <el-button type="primary" :disabled="flag =='N'" plain @click="asWnotnumConsole">选择</el-button>
                            </el-col>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="CAMPAIGN" prop="campalgn">
                            <el-input v-model="euaa.asCampaign2" :disabled="flag =='N'" @change="fun_checkCampaign2"  ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="EIB GRP" prop="eibgrpnumEibgrpname">
                            <el-row>
                                <el-col :span="12">
                                    <el-input v-model="euaa.asEibgrpnum" :disabled="flag =='N'" @change="checkAsEibgrpnum"></el-input>
                                </el-col>
                                <el-col :span="12">
                                    <el-input class="ml5" disabled v-model="euaa.asEibgrpname"></el-input>
                                </el-col>
                            </el-row>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="受理日" prop="hprrcvdt">
                            <el-input v-model="euaa.hprrcvdt" ref="hprrcvdt" :disabled="flag =='N'||euaa.riskType=='转投保'||euaa.riskType=='续保'" @change="checkAsHprrcvdt" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="体检别">
                            <el-select v-model="euaa.mmflg" :disabled="flag =='N'"  >
                                <el-option
                                v-for="item in mmflgs"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="Group" prop="asGroup">
                            <el-row>
                                <el-col :span="12">
                                    <el-input v-model="euaa.asCampaign1" :disabled="flag =='N'" @change="fun_checkCampaign1"></el-input>
                                </el-col>
                                <el-col :span="12">
                                    <el-input class="ml5" disabled v-model="euaa.longdescc"></el-input>
                                </el-col>
                            </el-row>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="投保书版本号码" prop="versionId">
                            <el-input v-model="euaa.versionId" disabled ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="建档日" prop="dtecrt">
                            <el-input disabled v-model="euaa.dtecrt" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="处理状态" prop="procflg">
                            <el-input disabled v-if="euaa.procflg==0" value="受理"></el-input>
                            <el-input disabled v-else-if="euaa.procflg==1" value="建档"></el-input>
                            <el-input disabled v-else-if="euaa.procflg==2" value="核保"></el-input>
                            <el-input disabled v-else-if="euaa.procflg==3" value="照会"></el-input>
                            <el-input disabled v-else-if="euaa.procflg==4" value="核决"></el-input>
                            <el-input disabled v-else-if="euaa.procflg==5" value="未入账"></el-input>
                            <el-input disabled v-else-if="euaa.procflg==6" value="结案"></el-input>
                            <el-input disabled v-else value="建档"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="模式代码" prop="modecode">
                            <el-input v-model="euaa.modecode"  :disabled="flag =='N'" clearable></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="类型" prop="appltype">
                            <el-input v-if="euaa.appltype==1" disabled value="寿险"/>
                            <el-input v-if="euaa.appltype==2" disabled value="意外险"/>
                            <el-input v-if="euaa.appltype==4" disabled value="投资型商品"/>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        <el-tabs type="card"  v-model="activeName"  @tab-click="selectionChanging">
            <el-tab-pane label="基本资料" class="tabsGrade" name="1">
                <policyRoleList ref="imPolicyRoleList" :insureData="insureData" :flag="flag" :isPopHide="isPopHide"
                    @changeFmlyreln="changeFmlyreln" @reloadAllCom="reloadAllCom"
                    @changeEuabs="changeEuabs" :getChildrenData="getChildrenData"></policyRoleList>
            </el-tab-pane>
            <el-tab-pane label="投保内容" class="tabsGrade" name="2">
                <!-- 寿险(投保内容) -->
               <insureConLife ref="imInsureConLife" v-if="euaa.appltype==1"
                  :insureData="insureData"  :flag="flag" :getChildrenData="getChildrenData"></insureConLife>
               <!-- 意外险(投保内容) -->
                <insureConAccident ref="imInsureConAccident" v-if="euaa.appltype==2"
                 @changeBillchnl="changeBillchnl" :insureData="insureData"  :flag="flag"></insureConAccident>
               <!-- 投资型(投保内容) -->
                <insureConInvest ref="imInsureConInvest" v-if="euaa.appltype==4"
                 @changeBillchnl="changeBillchnl"  :insureData="insureData"  :flag="flag" :getChildrenData="getChildrenData"></insureConInvest>
            </el-tab-pane>
            <el-tab-pane label="授权书资料维护" name="3">
                <Certificate ref="imCertificate" :insureData="insureData"  :flag="flag"></Certificate>
            </el-tab-pane>
            <el-tab-pane label="告知事项" name="4">
                <el-tabs type="border-card" class="tabsGrade_children" v-model="children_activeName">
                    <el-tab-pane label="健康告知" name="first">
                        <healthNotification ref="imHealth" :insureData="insureData"  :flag="flag"></healthNotification>
                    </el-tab-pane>
                    <el-tab-pane label="财务告知" name="second">
                        <financeNotification ref="imFinance" :insureData="insureData"  :flag="flag"></financeNotification>
                    </el-tab-pane>
                    <el-tab-pane label="投保经历" name="third">
                        <insureExperience ref="imInsureEx" :insureData="insureData" :flag="flag"></insureExperience>
                    </el-tab-pane>
                    <el-tab-pane label="营销员事项" name="fourth">
                        <salesman ref="imSalesman" :insureData="insureData" :flag="flag" :getChildrenData="getChildrenData"></salesman>
                    </el-tab-pane>
                </el-tabs>
            </el-tab-pane>
            <el-tab-pane label="检核事项" class="tabsGrade" name="5">
                <el-tabs type="border-card" class="tabsGrade_children" v-model="inspection_activeName">
                    <el-tab-pane label="投保书审核" name="first1">
                        <insuranceExamine ref="imInsuranceExa" :insureData="insureData" :flag="flag"></insuranceExamine>
                    </el-tab-pane>
                    <el-tab-pane label="附件审核" name="second1">
                        <annexExamine ref="imAnnexEx" :insureData="insureData" :flag="flag"></annexExamine>
                    </el-tab-pane>
                    <el-tab-pane label="反洗钱审核" name="third1">
                        <antiMoneyExamine ref="imAntiMoneyEx" :insureData="insureData" :flag="flag"></antiMoneyExamine>
                    </el-tab-pane>
                    <el-tab-pane label="其他审核" name="fourth1">
                        <otherExamine ref="imOtherEx" :insureData="insureData" :flag="flag"></otherExamine>
                    </el-tab-pane>
                </el-tabs>
            </el-tab-pane>
            <el-tab-pane label="光标跟随扩档" name="6">
                <cursorExtension ref="imCursorEx" :insureData="insureData" :flag="flag"></cursorExtension>
            </el-tab-pane>
            <el-tab-pane label="首期保费转账成功账户" name="7">
                <Account ref="imAccount" :insureData="insureData" :flag="flag"></Account>
            </el-tab-pane>
        </el-tabs>

        <!-- 操作按钮 -->
        <div class="fixd_botton_box">
            <el-row v-if="flag =='Y'">
                <el-col :span="24">
                    <el-tooltip class="item fixd_botton_dark" effect="dark" content="核保" placement="left">
                        <span @click="ueAsiSortClick" class="fixd_botton"><img :src="underwritPng" alt="核保"> </span >
                    </el-tooltip>
                </el-col>
                <el-col :span="24" class="mt5">
                    <el-tooltip class="item fixd_botton_dark" effect="dark" content="保存" placement="left">
                        <span @click="saveInsure" class="fixd_botton"><img :src="preservePng" alt="保存"> </span >
                    </el-tooltip>
                </el-col>
                <el-col :span="24" class="mt5">
                    <el-tooltip class="item fixd_botton_dark" effect="dark" content="返回" placement="left">
                        <span @click="back" class="fixd_botton"><img :src="gobackPng" alt="返回"> </span >
                    </el-tooltip>
                </el-col>
                 <el-col :span="24" class="mt5" v-if="euaa.procflg != 1">
                    <el-tooltip class="item fixd_botton_dark" effect="dark" content="照会" placement="left">
                        <span  @click="gotozh"  class="fixd_botton"><img :src="zhaohuiPng" alt="照会"> </span >
                    </el-tooltip>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24" class="mt5">
                    <el-tooltip class="item fixd_botton_dark" effect="dark" content="核保意见" placement="left">
                        <span @click="showOpinionTable" class="fixd_botton"><img :src="zhaohuiPng" alt="核保意见"> </span >
                    </el-tooltip>
                </el-col>
            </el-row>
        </div>

        <!-- 弹框 收款凭证（选择按钮）-->
        <el-dialog
            title="收款凭证"
            :visible.sync="wnotnumDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            :show-close="false"
            width="50%"
            center>
            <el-row>
                <el-col :span="24">
                    <el-button @click="addEuca" type="danger" plain>增加</el-button>
                </el-col>
                <el-col :span="24">
                    <el-table class="mt20"
                        ref="multipleTable"
                        :data="eucas"
                        tooltip-effect="dark"
                        style="width: 100%">
                        <!-- <el-table-column
                        type="selection"
                        width="55">
                        </el-table-column> -->
                        <el-table-column
                        label="收费凭证号码">
                        <template slot-scope="scope">
                            <el-input :maxlength="9" v-model="scope.row.wnotnum"
                                :disabled="scope.row.crtuser != ''"
                                @blur="fun_checkWnotnum(scope.$index,scope.row)" ></el-input>
                        </template>
                        </el-table-column>
                        <el-table-column
                        prop="name"
                        label="POS机系统参考码">
                        <template slot-scope="scope">
                            <el-input disabled placeholder="POS机系统参考码"></el-input>
                        </template>
                        </el-table-column>
                            <el-table-column
                            label="操作">
                            <template slot-scope="scope">
                                <span class="operationIcon" @click="removeEuca(scope.$index, scope.row)">
                                    <!-- 删除操作 -->
                                    <el-tooltip class="item" effect="light" content="删除" placement="">
                                        <i class="el-icon-delete"></i>
                                    </el-tooltip>
                                </span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <span slot="footer" class="dialog-footer">
                <el-button @click="reWnotnumAfter">返 回</el-button>
                <!--
                <el-button type="primary" @click="wnotnumDialogVisible = false">保 存</el-button>
                -->
            </span>
        </el-dialog>

        <!-- 可疑名单列表-->
        <el-dialog
            title="可疑名单列表"
            :visible.sync="blacklistDialogVisible"
            width="50%"
            center>
            <el-row>
                <el-col :span="24">
                    <el-table class="mt20"
                        ref="multipleTable"
                        :data="blacklist"
                        tooltip-effect="dark"
                        style="width: 100%">
                        <el-table-column
                            prop="clntnum"
                            label="客户号">
                            <template slot-scope="scope">
                                <div>{{scope.row.clntnum}}</div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            prop="dbtrade"
                            label="可疑标志">
                            <template slot-scope="scope">
                                <div>{{scope.row.dbtrade}}</div>
                            </template>
                         </el-table-column>
                         <el-table-column
                            prop="ssds"
                            label="描述">
                            <template slot-scope="scope">
                                <div>{{scope.row.ssds}}</div>
                            </template>
                         </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <span slot="footer" class="dialog-footer">
                <el-button @click="qrBlank">确认</el-button>
            </span>
        </el-dialog>

        <!-- 核保意见列表-->
        <el-dialog
            title="核保意见列表"
            :visible.sync="opinionDialogVisible"
            width="50%"
            center>
            <el-row>
                <el-col :span="24">
                    <el-table class="mt20"
                        ref="multipleTable"
                        :data="opinionData"
						@row-click="changeBmntdesc"
                        tooltip-effect="dark"
                        style="width: 100%">
                        <el-table-column
                            type="index"
                            width="50">
                        </el-table-column>
                        <el-table-column
                            prop="applnum"
                            label="受理号码">
                            <template slot-scope="scope">
                                <div>{{scope.row.applnum}}</div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            prop="bmntdesc"
                            label="核保意见">
                            <template slot-scope="scope">
                                <div>{{scope.row.bmntdesc}}</div>
                            </template>
                         </el-table-column>
                         <el-table-column
                            prop="effdate"
                            label="日期">
                            <template slot-scope="scope">
                                <div>{{scope.row.effdate}}</div>
                            </template>
                         </el-table-column>
                         <el-table-column
                            prop="userProfile"
                            label="用户">
                            <template slot-scope="scope">
                                <div>{{scope.row.userProfile}}</div>
                            </template>
                         </el-table-column>
                    </el-table>
                </el-col>
				<el-col>
					<el-input disabled v-if="showOpinion"
					          type="textarea"
					          :rows="3"
					          v-model="bmntdesc"
					          >
					</el-input>
				</el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <div class="pagination">
                        <el-pagination
                            background
                            v-if='paginations_O.total > 0'
                            :page-sizes="paginations_O.pageSizes"
                            :page-size="paginations_O.pageSize"
                            :layout="paginations_O.layout"
                            :total="paginations_O.total"
                            :current-page='paginations_O.pageIndex'
                            @current-change='handleCurrentChange_O'
                            @size-change='handleSizeChange_O'>
                        </el-pagination>
                    </div>
                </el-col>
            </el-row>
            <span slot="footer" class="dialog-footer">
                <el-button @click="opinionBlank">返回</el-button>
            </span>
        </el-dialog>
        <div v-if="subUnLoading" v-loading="subUnLoading"
            element-loading-text="拼命加载中..."
            element-loading-spinner="el-icon-loading"
            class="sub-loading">
        </div>
    </div>
</template>
<script>
import {
    saveFiles, ueAsiSort, checkFlag10, checkSrcebus, checkAsCampaign2,
    checkAsCampaign1, checkAsHprrcvdt, checkAsAppldate, checkAsEibgrpnum,
    fCalAssAge, callPrcCHKPLTC, checkDoubtList, getfileInfo, getOpinionPage,
    checkWnotnum, reWnotnumAfter, selectPolplnTab, switchInsuredInfo
} from "@/api/policyRecord/materialsMaintain/insurance";
import constant from '@/utils/constant';
import {Message, MessageBox} from 'element-ui';
import underwritPng from "@/assets/img/botton/underwrit.png"
import zhaohuiPng from "@/assets/img/botton/zhaohui.png"
import preservePng from "@/assets/img/botton/preserve.png"
import gobackPng from "@/assets/img/botton/goback.png"
// import pageCall from "@/utils/pageCall";
export default {
    components: {
        policyRoleList: resolve => require(['./policyRoleList.vue'], resolve),
        insureConLife: resolve => require(['./insureConLife.vue'], resolve),
        insureConAccident: resolve => require(['./insureConAccident.vue'], resolve),
        insureConInvest: resolve => require(['./insureConInvest.vue'], resolve),
        Certificate: resolve => require(['./certificate.vue'], resolve),
        Account: resolve => require(['./account.vue'], resolve),
        insuranceExamine: resolve => require(['./insuranceExamine.vue'], resolve),
        annexExamine: resolve => require(['./annexExamine.vue'], resolve),
        antiMoneyExamine: resolve => require(['./antiMoneyExamine.vue'], resolve),
        otherExamine: resolve => require(['./otherExamine.vue'], resolve),
        cursorExtension: resolve => require(['./cursorExtension.vue'], resolve),
        healthNotification: resolve => require(['./healthNotification.vue'], resolve),
        financeNotification: resolve => require(['./financeNotification.vue'], resolve),
        insureExperience: resolve => require(['./insureExperience.vue'], resolve),
        salesman: resolve => require(['./salesman.vue'], resolve),
     },
    data(){
        return{
			//核保意见
			showOpinion:false,
			bmntdesc:'',
            value:'',
            wnotnumDialogVisible:false,//默认隐藏[收款凭证]弹框
            underwritPng:underwritPng,
            preservePng:preservePng,
            gobackPng:gobackPng,
            zhaohuiPng:zhaohuiPng,
            activeName: '1',
            children_activeName:"first",
            inspection_activeName:'first1',
            parentIndex: '1',
            euaa: {},
            rules:{},
            flag10s:[
                {value:'',label:''},
                {value:'A',label:'A-AUTOPAYOUT'},
                {value:'C', label:'C-银行代收/现金缴费'},
                {value:'M',label:'M-支票/电子转账'},
                {value:'P',label:'P-POS机收费'}
            ],
            fmlyrelns: [
                {value:'',label:''},
                {value: '1',label: '1-本人'},
                {value: '2',label: '2-配偶'},
                {value: '3',label: '2-子女'},
                {value: '4',label: '4-兄弟姐妹'},
                {value: '5',label: '5-父母'},
                {value: '6',label: '6-其他'},
                {value: '7',label: '7-法定继承'},
                {value: '8',label: '8-雇佣'},
                {value: '9',label: '9-债权人'},
                {value: 'A',label: 'A-祖父母及外祖父母'}
            ],
            mmflgs: [
                {value: 'N',label: 'N-免体检件'},
                {value: 'M',label: 'M-体检件'},
                {value: 'R',label: 'R-抽检件'},
                {value: 'O',label: 'O-病史件'}
            ],
            eucas: {},
            insureData: {
               euaa:{},euad1:{},euad2:{},
               memberinfo1:{},memberinfo2:{},
               memberinfo3:{},euabs:[],plybnfts:{},
               euaes:[],euais:[],ztops:[],euag:{},
               euafs:[],cusf01List:[],cusf02List:[],
               cusf04List:[],cusf05List:[],
               cusf07List:[],cusf08List:[],fnncllnfrm:{},
               insurexprn:{},agentmatter:{},applctnexam:{},
               annexexam:{},antimoney:{},otherexam:{},
               eucas:[],zbxt:{},euaisTemList:[],
               // 第二被保人需求
               euad3:{},memberinfo4:{}
            },
            oldInsureData: {},
            euaa_asWnotnum_readonly: false,
            isPopHide: false,
            blacklist: [],
            blacklistDialogVisible:false,
            applnum: '',
            flag: 'N',
            /*核保意见弹框相关*/
            opinionDialogVisible: false, // 控制弹框是否显示
            opinionData: [], // 核保意见表格数据
            paginations_O: { // 核保意见表格分页数据
                total: 0,    // 总数
                pageIndex: 1,// 当前位于哪页
                pageSize: 5, // 1页显示多少条
                pageSizes: [5, 10, 15, 20],  //每页显示多少条
                layout: "total, sizes, prev, pager, next, jumper"   // 翻页属性
            },
            subUnLoading:false,
        }
    },
    props:{

    },
    mounted(){
        //this.queryByApplnum();
      // 职业代码变更后进行资料保存操作
      /*pageCall.$on("checkOccpcdenAfterSaveInsure",()=>{
        console.log("职业代码变更, 开始保存资料");
        this.saveInsure();
        console.log("职业代码变更, 资料保存完成");
      });*/
    },
    activated(){
        this.$destroyCacheKey();
        let pageSource = this.$route.query.pageSource;
        if(pageSource=='hb' || pageSource=='jd' || pageSource=='cx'){
            this.euaa.applnum = '';
        }
        if(!this.euaa.applnum){
           this.queryByApplnum();
        }
		let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
		let userId = userInfo.account;

        document.onkeydown = this.saveByF8;
    },
    destroyed() {
        document.onkeydown = null;
    },
    methods:{
        saveByF8(event){
            var e = event || window.event || arguments.callee.caller.arguments[0];
            //F8保存
            if (e && e.keyCode == 119) {
                if(this.flag == 'Y'){
                    this.saveInsure();
                }
            }
            //F9核保
            if (e && e.keyCode == 120) {
                if(this.flag == 'Y'){
                    this.ueAsiSortClick();
                }
            }
        },
		//核保意见点击显示详细
		changeBmntdesc(row){
			this.showOpinion = true;
			this.bmntdesc = row.bmntdesc;
		},
        queryByApplnum(){
            this.subUnLoading = true;
            let applnum = this.$route.params.applnum;
            let flag = this.$route.params.flag;
            this.applnum = applnum;
            this.flag = flag;
            let para = {applnum: this.applnum,flag: this.flag};
            getfileInfo(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    let data = res.data;
                    console.info("建档资料查询结果",data);
                    this.oldInsureData = JSON.parse(JSON.stringify(data));
                    this.insureData = this.recombination(data);
                    this.euaa = this.insureData.euaa;
                    this.eucas = this.insureData.eucas;
                    this.loadChildrenData();
                }
                this.subUnLoading = false;
            }).catch(err =>{
                console.log(err);
                this.clearTag();
                this.subUnLoading = false;
            })
        },
        //保存和核保前页面校验
        preSave(){
            let formData = this.getChildrenData();
            let euaeList = formData.euaes;
            for(let i = 0 ; i < euaeList.length ; i++){
                let seqno = euaeList[i].seqno + '';
                console.info("受益人列表顺序",seqno);
                if(seqno == ''){
                    console.info("受益人列表顺序为空",seqno);
                    this.$message({
                        message: '受益人列表顺序不能为空,请输入',
                        type: 'error'
                    });
                    return false;
                }
            }
            return true;
        },
        recombination(result){//重组查询结果
           let reresult = {
               euaa:result.mainInfo,euad1:result.policy,euad2:result.insurant,
               memberinfo1:result.policyAttach,memberinfo2:result.insurantAttach,
               memberinfo3:result.policyInfo,
               euabs:result.insurancePlan.planList,plybnfts:result.plybnfts,
               euaes:result.beneficiary.beneficiaryList,
               euais:result.accountDetails.accountList,
               ztops:result.additionalInvestment.additionalList,
               euag:result.writtenAuthorization,
               euafs:result.informedObject.objectList,
               cusf01List:result.familyHistory,
               cusf02List:result.entryError,cusf03List:result.reviewOpinion.opinionList,
               cusf04List:result.preliminaryOpinion,
               cusf05List:result.insuranceExperience,cusf06List:result.financialInformed,
               cusf07List:result.preliminaryOpinion,
               cusf08List:result.inputOpinion,fnncllnfrm:result.fnncllnfrm,
               insurexprn:result.insurexprn,
               agentmatter:result.agentmatter,applctnexam:result.applctnexam,
               annexexam:result.annexexam,antimoney:result.antimoney,otherexam:result.otherexam,
               eucas:result.receipt.receiptList,
               zbxt:result.premiumAccount,euaisTemList:result.accountTemList,
               isContainRate:result.isContainRate,
               // 第二被保人需求
               euad3: result.secondInsurant,memberinfo4: result.secondInsurantAttach,
               // 首期保费转账成功账户
               zbxu:result.premiumAccount2

            };
           return reresult;
        },
        fitTogetherPara(){//重新拼装修改数据,修改标记
            let formData = this.getChildrenData();
            let newData = JSON.parse(JSON.stringify(this.oldInsureData));
            console.info("重新拼装修改数据,修改标记formData",formData);
            console.info("重新拼装修改数据,修改标记newData",newData);
            newData.mainInfo = formData.euaa;//主档
            if(JSON.stringify(formData.euad1) != JSON.stringify(newData.policy)){
                newData.policy = formData.euad1;
                newData.policy.modifyMarke = "Y";
            }
            newData.policy.modifyMarke = "Y";//如果维护作业修改职等会导致数据不能存库，标记为修改
            if(JSON.stringify(formData.euad2) != JSON.stringify(newData.insurant)){
                newData.insurant = formData.euad2;
                newData.insurant.modifyMarke = "Y";
            }
            newData.insurant.modifyMarke = "Y";//如果维护作业修改职等会导致数据不能存库，标记为修改
            // 第二被保人需求 start
            if (formData.euad3.surname && formData.euad3.asId) {
                if (JSON.stringify(formData.euad3) != JSON.stringify(newData.secondInsurant)) {
                    newData.secondInsurant = formData.euad3;
                    newData.secondInsurant.modifyMarke = "Y";
                }
                newData.secondInsurant.modifyMarke = "Y"; //如果维护作业修改职等会导致数据不能存库，标记为修改
                if (JSON.stringify(formData.memberinfo4) != JSON.stringify(newData.secondInsurantAttach)) {
                    newData.secondInsurantAttach = formData.memberinfo4;
                    newData.secondInsurantAttach.modifyMarke = "Y";
                }
            }
            // 第二被保人需求 end
            if(JSON.stringify(formData.memberinfo1) != JSON.stringify(newData.policyAttach)){
                newData.policyAttach = formData.memberinfo1;
                newData.policyAttach.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.memberinfo2) != JSON.stringify(newData.insurantAttach)){
                newData.insurantAttach = formData.memberinfo2;
                newData.insurantAttach.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.memberinfo3) != JSON.stringify(newData.policyInfo)){
                newData.policyInfo = formData.memberinfo3;
                newData.policyInfo.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.euabs) != JSON.stringify(newData.insurancePlan.planList)){
                newData.insurancePlan.planList = formData.euabs;
                newData.insurancePlan.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.plybnfts) != JSON.stringify(newData.plybnfts)){
                newData.plybnfts = formData.plybnfts;
                newData.plybnfts.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.euaes) != JSON.stringify(newData.beneficiary.beneficiaryList)){
                newData.beneficiary.beneficiaryList = formData.euaes;
                newData.beneficiary.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.euais) != JSON.stringify(newData.accountDetails.accountList)){
                newData.accountDetails.accountList = formData.euais;
                newData.accountDetails.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.ztops) != JSON.stringify(newData.additionalInvestment.additionalList)){
                newData.additionalInvestment.additionalList = formData.ztops;
                newData.additionalInvestment.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.euag) != JSON.stringify(newData.writtenAuthorization)){
                newData.writtenAuthorization = formData.euag;
                newData.writtenAuthorization.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.euafs) != JSON.stringify(newData.informedObject.objectList)){
                newData.informedObject.objectList = formData.euafs;
                newData.informedObject.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.cusf03List) != JSON.stringify(newData.reviewOpinion.opinionList)){
                newData.reviewOpinion.opinionList = formData.cusf03List;
                newData.reviewOpinion.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.fnncllnfrm) != JSON.stringify(newData.fnncllnfrm)){
                newData.fnncllnfrm = formData.fnncllnfrm;
                newData.fnncllnfrm.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.insurexprn) != JSON.stringify(newData.insurexprn)){
                newData.insurexprn = formData.insurexprn;
                newData.insurexprn.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.agentmatter) != JSON.stringify(newData.agentmatter)){
                newData.agentmatter = formData.agentmatter;
                newData.agentmatter.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.applctnexam) != JSON.stringify(newData.applctnexam)){
                newData.applctnexam = formData.applctnexam;
                newData.applctnexam.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.annexexam) != JSON.stringify(newData.annexexam)){
                newData.annexexam = formData.annexexam;
                newData.annexexam.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.antimoney) != JSON.stringify(newData.antimoney)){
                newData.antimoney = formData.antimoney;
                newData.antimoney.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.otherexam) != JSON.stringify(newData.otherexam)){
                newData.otherexam = formData.otherexam;
                newData.otherexam.modifyMarke = "Y";
            }
            if(JSON.stringify(formData.eucas) != JSON.stringify(newData.receipt.receiptList)){
                newData.receipt.receiptList = formData.eucas;
                newData.receipt.modifyMarke = "Y";
            }
            newData.accountTemList = null;
			//费率是否改变
			newData['rateChange'] = formData.rateChange;
			//是否是费率相关的投保
			newData['isContainRate'] = formData.isContainRate;
          // 第二被保人需求 start
          if(JSON.stringify(formData.euad3) != JSON.stringify(newData.secondInsurant)){
            newData.secondInsurant = formData.euad3;
            newData.secondInsurant.modifyMarke = "Y";
          }
          if(JSON.stringify(formData.memberinfo4) != JSON.stringify(newData.secondInsurantAttach)){
            newData.secondInsurantAttach = formData.memberinfo4;
            newData.secondInsurantAttach.modifyMarke = "Y";
          }
          // 第二被保人需求 end
            return newData;
        },
        saveInsure(){
            if(this.preSave() == false){
                return;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            var that = this;
            let para = this.fitTogetherPara();
            console.info("提交修改数据",para);
            saveFiles(para).then(function (res) {
                if(res.resultCode == constant.SUCCESS){
                   if(res.data.message != undefined){
                        that.$alert(res.data.message, '提示', {
                        confirmButtonText: '确定',
                       });
                   }
                   if(res.data.info != undefined){
                        that.$message({
                            message: res.data.info,
                            type: 'error'
                        });
                        //that.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                        //return false;
                        if(res.data.euabList != undefined){
                            let euabStrs = JSON.stringify(res.data.euabList);
                            that.changeEuabs(euabStrs);
                        }
                    }
                    if(res.data.success != undefined){
                       that.$message({
                            message: res.data.success + '',
                            type: 'success'
                        });
                        that.queryByApplnum();
                    }
                   //that.queryByApplnum();
                }else{
                   // that.$message.error(res.resultMsg);
                }
                that.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            }).catch(err =>{
                console.log(err);
                that.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        submitUeasiSort(flag){
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            var that = this;
            let para = this.fitTogetherPara();
            para.antimoney.applInDoub = flag;
            para.antimoney.insuInDoub = flag;
            para.antimoney.bnyInDoub = flag;
            let applnum = that.euaa.applnum;
            let chdrnum = that.euaa.chdrnum;
            let pageSource = 'jd';
            ueAsiSort(para).then(function (res) {
                if(res.resultCode == constant.SUCCESS){
                    if(res.data.procflg != undefined){
                        if(res.data.procflg == '4'){
                            that.$message({
                                message: '受理号码 (' + applnum + '),保单号码(' + chdrnum + ') 已完成核决',
                                type: 'success'
                            });
                            that.clearTag();
                            that.$router.push({path:'/home/policyRecord/baseInfo'+'/'+applnum+'/N',query:{
                                pageSource:'jd'
                            }}).catch(data => {});
                        }else{
                            that.$message({
                                message: '受理号 ' + applnum + ' 已核保成功,进入核保照会页面!',
                                type: 'success'
                            });
                            that.gotozh();
                        }
                    }
                    if(res.data.info != undefined){
                        that.$message.error(res.data.info);
                        if(res.data.euabList != undefined){
                            let euabStrs = JSON.stringify(res.data.euabList);
                            that.changeEuabs(euabStrs);
                        }
                    }
                }else{
                    //that.$message.error(res.resultMsg);
                }
                that.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            }).catch(err =>{
                console.log(err);
                that.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            });
        },
        qrBlank(){
            this.submitUeasiSort('Y');
            this.blacklistDialogVisible = false;
            //document.getElementById("scf1pkyForm.ind58").value=result;
            //document.getElementById("scf1pkyForm.ind59").value=result;
            //document.getElementById("scf1pkyForm.ind60").value=result;
        },
        checkSecInsuredRule() {
            console.log("双被保人切换 start")
            let data = this.insureData;
            let euabs = data.euabs;

            let doubleInsured = false;

            for (let i = 0; i < euabs.length; i++) {
                let crtable = euabs[i].crtable;
                // 双被保人涉及切换险种代码
                if ((crtable === "WLS8" || crtable === "WLSW" || crtable === "WLSI"
                || crtable === "WLSJ" || crtable === "WLSM" || crtable === "WLSN")) {
                    doubleInsured = true;
                }
            }

            if (!doubleInsured) {
                return false;
            }

            let euad2 = data.euad2;
            let euad3 = data.euad3;

            let cltdob, secCltdob, cltSex, secCltSex, anbAtCcd2, secAnbAtCcd2;

            cltdob = euad2.cltdob;
            secCltdob = euad3.cltdob;
            cltSex = euad2.cltsex;
            secCltSex = euad3.cltsex;
            anbAtCcd2 = euad2.anbAtCcd2;
            secAnbAtCcd2 = euad3.anbAtCcd2;

            console.log("第一被保人出生日期:"+ cltdob +", 性别:" + cltSex + ", 年龄:" + anbAtCcd2 +"; 第二被保人出生日期: "+ secCltdob +", 性别:" + secCltSex + ", 年龄:" + secAnbAtCcd2)

            if (anbAtCcd2 > secAnbAtCcd2) {
                return  true;
            } else if (anbAtCcd2 == secAnbAtCcd2){
                if ('M' == cltSex && 'F' == secCltSex) {
                    return  true;
                }
            }
            return false;
        },
        async ueAsiSortClick(){
            if (this.checkSecInsuredRule() == true) {
                await MessageBox.confirm("是否需要切换双被保人信息", '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(async () => {
                    let param = {
                        "applnum": this.applnum,
                        "clntnum": this.insureData.euad2.clntnum,
                        "secClntnum": this.insureData.euad3.clntnum
                    }
                    await switchInsuredInfo(param).then((res)=> {
                        if (res.resultCode == 0) {
                            this.$message({
                                message: '双被保人信息切换成功',
                                type: 'success'
                            });
                            location.reload();
                        } else {
                            return;
                        }
                    }).catch(err => {});
                }).catch(action => {
                    /*let curDate = 0;
                    if(this.euaa.curTime){
                        let time = new Date(this.euaa.curTime);
                        let y = time.getFullYear();
                        let m = time.getMonth() + 1;
                        let d = time.getDate();
                        curDate = y+'/'+(m<10?'0'+m:m)+'/'+(d<10?'0'+d:d);
                    }
                    if(curDate != this.euaa.businessDate){
                        let title = '中台服务器的日期和400服务器的日期不一致，中台【'+curDate+'】,400【'+this.euaa.businessDate+'】,是否继续?';
                        MessageBox.confirm(title, '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            this.ueAsiSort();
                        }).catch(action => {

                        });
                    }else{
                        this.ueAsiSort();
                    }*/
                });


            } else {
                let curDate = 0;
                if(this.euaa.curTime){
                    let time = new Date(this.euaa.curTime);
                    let y = time.getFullYear();
                    let m = time.getMonth() + 1;
                    let d = time.getDate();
                    curDate = y+'/'+(m<10?'0'+m:m)+'/'+(d<10?'0'+d:d);
                }
                if(curDate != this.euaa.businessDate){
                    let title = '中台服务器的日期和400服务器的日期不一致，中台【'+curDate+'】,400【'+this.euaa.businessDate+'】,是否继续?';
                    MessageBox.confirm(title, '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        this.ueAsiSort();
                    }).catch(action => {

                    });
                }else{
                    this.ueAsiSort();
                }
            }
        },
        async ueAsiSort(){
            //let para = this.getChildrenData();
            if(this.preSave() == false){
                return;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            await this.checkBackList();//核保前检查黑名单
            let flag = await this.checkDoubtList();//核保前检查可疑名单
            if(flag == false){//无可疑名单，有可疑名单时页面确认后提交核保
                this.submitUeasiSort('N');
            }
        },
        back(){
            //this.clearTag();
            //this.$router.push({path:'/home/policyRecord/fileInfolMaintain'});
            //this.$router.go(-1);
            this.$router.go(-1)
        },
        clearTag(){
            try {
                let that = this;
                let activeTag = JSON.parse(sessionStorage.getItem('tagActive'));
                if(activeTag.length > 1){
                    activeTag.map((item,index) =>{
                    // debugger
                    if(item.path == that.$route.path)
                        activeTag.splice(index,1);
                    })
                } else if (this.activeTag.length == 1) {
                    activeTag.map((item,index) =>{
                    // debugger
                    if(item.path == that.$route.path && item.path !='/home/taskHome')
                        activeTag.splice(index,1);
                    })
                }
                sessionStorage.setItem("tagActive",JSON.stringify(activeTag));
                that.$store.dispatch('setTagActive',activeTag);
                if(activeTag.length > 1){
                    that.$router.push({path:activeTag[activeTag.length-1].path});
                }
            } catch (e) {
                console.log(e);
            }
        },
        gotozh(){
            this.clearTag();
            let pageSource = 'jd';
            let applnum = this.euaa.applnum;
            this.$router.push({path:'/underwrite/info'+'/'+applnum+'/'+pageSource});
        },
        addEuca(){
            let euca = {
                "applnum": "","wnotnum": "",
                "crtuser": "","dtecrt": ""
            }
            this.eucas.push(euca);
        },
        removeEuca(index,row){
            this.eucas.splice(index,1);
        },
        reloadAllCom(flag){
            let data = this.getChildrenData();
            let oldClntnum1 = data.euad1.oldClntnum;
            let oldClntnum2 = data.euad2.oldClntnum;
            // 第二被保人
            let oldClntnum3 = data.euad3.oldClntnum;
            if(flag=='1'){
                data.euad1.height = 0;
                data.euad1.weight = 0;
                data.euad1.bmi = 0;
                if(data.euad1.fmlyreln == '1' &&
                    data.euad1.clntnum == data.euad2.clntnum){
                    data.euad2.height = 0;
                    data.euad2.weight = 0;
                    data.euad2.bmi = 0;
                }
            }else if(flag=='2'){
               data.euad2.height = 0;
               data.euad2.weight = 0;
               data.euad2.bmi = 0;
            }else if(flag == '3') {
               data.euad3.height = 0;
               data.euad3.weight = 0;
               data.euad3.bmi = 0;
            }
            //投保计划
            for(let i = 0; i < data.euabs.length; i++){
                var clntnum = data.euabs[i].clntnum;
                if(clntnum != '' && clntnum == oldClntnum2){
                    let newSecuityno = data.euad2.secuityno;
                    data.euabs[i].clntnum = data.euad2.clntnum;
                    data.euabs[i].asId  = newSecuityno;
                    data.euabs[i].asName  = data.euad2.surname;
                    data.euabs[i].asSex = data.euad2.cltsex;
                }else if(clntnum != '' && clntnum == oldClntnum1){
                    let newSecuityno = data.euad1.secuityno;
                    data.euabs[i].clntnum = data.euad1.clntnum;
                    data.euabs[i].asId  = newSecuityno;
                    data.euabs[i].asName  = data.euad1.surname;
                    data.euabs[i].asSex = data.euad1.cltsex;
                } else if (clntnum != '' && clntnum == oldClntnum3) {
                  // 第二被保人
                  let newSecuityno = data.euad3.secuityno;
                  data.euabs[i].clntnum = data.euad3.clntnum;
                  data.euabs[i].asId  = newSecuityno;
                  data.euabs[i].asName  = data.euad3.surname;
                  data.euabs[i].asSex = data.euad3.cltsex;
                }else{//默认使用被保险人
                    let newSecuityno = data.euad2.secuityno;
                    data.euabs[i].clntnum = data.euad2.clntnum;
                    data.euabs[i].asId  = newSecuityno;
                    data.euabs[i].asName  = data.euad2.surname;
                    data.euabs[i].asSex = data.euad2.cltsex;
                }
            }
            //健康告知
            for(let i = 0; i < data.euafs.length; i++){
                var clntnum = data.euafs[i].clntnum;
                if(clntnum != '' && clntnum == oldClntnum2){
                    data.euafs[i].clntnum = data.euad2.clntnum;
                    data.euafs[i].surname  = data.euad2.surname;
                    data.euafs[i].userName  = data.euad2.surname;
                }else if(clntnum != '' && clntnum == oldClntnum1){
                    data.euafs[i].clntnum = data.euad1.clntnum;
                    data.euafs[i].surname  = data.euad1.surname;
                    data.euafs[i].userName  = data.euad1.surname;
                }else if (clntnum != '' && clntnum == oldClntnum3) {
                    // 第二被保人
                    data.euafs[i].clntnum = data.euad3.clntnum;
                    data.euafs[i].surname  = data.euad3.surname;
                    data.euafs[i].userName  = data.euad3.surname;
                }
            }
            //授权书
            var payrnum = data.euag.payrnum;
            if (payrnum == "") {
                data.euag.asId = data.euad1.secuityno;
                data.euag.asName = data.euad1.surname;
                data.euag.payrnum = data.euad1.clntnum;
            } else {
                if (payrnum == oldClntnum1) {
                     data.euag.asId = data.euad1.secuityno;
                     data.euag.asName = data.euad1.surname;
                     data.euag.payrnum = data.euad1.clntnum;
                } else {
                    if (payrnum == oldClntnum2) {
                       data.euag.asId = data.euad2.secuityno;
                       data.euag.asName = data.euad2.surname;
                       data.euag.payrnum = data.euad2.clntnum;
                    } else if (payrnum == oldClntnum3) {
                      // 第二被保人
                      data.euag.asId = data.euad3.secuityno;
                      data.euag.asName = data.euad3.surname;
                      data.euag.payrnum = data.euad3.clntnum;
                    }
                }
            }
            this.insureData = data;
            this.loadChildrenData();
        },
        loadChildrenData(){//更新子组件值
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            if(this.euaa.flag10 == 'A'){
                this.euaa_asWnotnum_readonly = true;
            }
            if(this.$refs.imPolicyRoleList != undefined){
                this.$refs.imPolicyRoleList.reloadInsureData(this.insureData);
            }
            if(this.$refs.imInsureConLife != undefined){
                this.$refs.imInsureConLife.reloadInsureData(this.insureData);
            }
            if(this.$refs.imInsureConAccident != undefined){
                this.$refs.imInsureConAccident.reloadInsureData(this.insureData);
            }
            if(this.$refs.imInsureConInvest != undefined){
                this.$refs.imInsureConInvest.reloadInsureData(this.insureData);
            }
            if(this.$refs.imCertificate != undefined){
                this.$refs.imCertificate.reloadInsureData(this.insureData);
            }
            if(this.$refs.imHealth != undefined){
                this.$refs.imHealth.reloadInsureData(this.insureData);
            }
            if(this.$refs.imFinance != undefined){
                this.$refs.imFinance.reloadInsureData(this.insureData);
            }
            if(this.$refs.imInsureEx != undefined){
                this.$refs.imInsureEx.reloadInsureData(this.insureData);
            }
            if(this.$refs.imSalesman != undefined){
                this.$refs.imSalesman.reloadInsureData(this.insureData);
            }
            if(this.$refs.imInsuranceExa != undefined){
                this.$refs.imInsuranceExa.reloadInsureData(this.insureData);
            }
            if(this.$refs.imAnnexEx != undefined){
                this.$refs.imAnnexEx.reloadInsureData(this.insureData);
            }
            if(this.$refs.imAntiMoneyEx != undefined){
                this.$refs.imAntiMoneyEx.reloadInsureData(this.insureData);
            }
            if(this.$refs.imOtherEx != undefined){
                this.$refs.imOtherEx.reloadInsureData(this.insureData);
            }
            if(this.$refs.imCursorEx != undefined){
                this.$refs.imCursorEx.reloadInsureData(this.insureData);
            }
            if(this.$refs.imAccount != undefined){
                this.$refs.imAccount.reloadInsureData(this.insureData);
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
        },
        getChildrenData(){
            let data = this.insureData;
            if(this.$refs.imPolicyRoleList != undefined){
               let formData =  this.$refs.imPolicyRoleList.getInsureData();
               data.euad1 = formData.euad1;
               data.euad2 = formData.euad2;
               data.euaes = formData.euaes;
               data.memberinfo1 = formData.memberinfo1;
               data.memberinfo2 = formData.memberinfo2;
               data.memberinfo3 = formData.memberinfo3;
               // 第二被保人需求
               data.euad3 = formData.euad3;
               data.memberinfo4 = formData.memberinfo4;
            }
            if(this.$refs.imInsureConLife != undefined){
                let formData =  this.$refs.imInsureConLife.getInsureData();
                data.euabs = formData.euabs;
                data.euaa.firstpremTotal = formData.euaa.firstpremTotal;
                data.euaa.instPrem02 = formData.euaa.instPrem02;
                data.euaa.caldate = formData.euaa.caldate;
                data.euaa.billfreq = formData.euaa.billfreq;
                data.euaa.billchnl = formData.euaa.billchnl;
                data.euaa.bnsind = formData.euaa.bnsind;
                data.euaa.annloan = formData.euaa.annloan;
                data.euaa.nextbdate = formData.euaa.nextbdate;
                data.plybnfts = formData.plybnfts;
            }
            if(this.$refs.imInsureConAccident != undefined){
                let formData =  this.$refs.imInsureConAccident.getInsureData();
                data.euabs = formData.euabs;
                data.euaa.firstpremTotal = formData.euaa.firstpremTotal;
                data.euaa.instPrem02 = formData.euaa.instPrem02;
                data.euaa.billfreq = formData.euaa.billfreq;
                data.euaa.billchnl = formData.euaa.billchnl;
                data.euaa.caldate = formData.euaa.caldate;
                data.plybnfts = formData.plybnfts;
            }
            if(this.$refs.imInsureConInvest != undefined){
                let formData =  this.$refs.imInsureConInvest.getInsureData();
                data.euabs = formData.euabs;
                data.euaa.firstpremTotal = formData.euaa.firstpremTotal;
                data.euaa.instPrem02 = formData.euaa.instPrem02;
                data.euaa.billfreq = formData.euaa.billfreq;
                data.euaa.billchnl = formData.euaa.billchnl;
                data.euaa.caldate = formData.euaa.caldate;
                data.euaa.flag05 = formData.euaa.flag05;
                data.euaa.nextbdate = formData.euaa.nextbdate;
                data.plybnfts = formData.plybnfts;
                data.ztops = formData.ztops;
                data.euais = formData.euais;
            }
            if(this.$refs.imCertificate != undefined){
                let formData =  this.$refs.imCertificate.getInsureData();
                //data.euaa.billchnl = formData.euaa.billchnl;
                data.euag = formData.euag;
            }
            if(this.$refs.imHealth != undefined){
                let formData =  this.$refs.imHealth.getInsureData();
                //data.euad1.surname = formData.euad1.surname;
                if(data.euad1.fmlyreln == '1' &&
                    data.euad1.clntnum==data.euad2.clntnum){
                    data.euad1.height = formData.euad2.height;
                    data.euad1.weight = formData.euad2.weight;
                    data.euad1.bmi = formData.euad2.bmi;
                }else{
                    data.euad1.height = formData.euad1.height;
                    data.euad1.weight = formData.euad1.weight;
                    data.euad1.bmi = formData.euad1.bmi;
                }
                data.euad1.physclExamFlag1 = formData.euad1.physclExamFlag1;
                //data.euad2.surname = formData.euad2.surname;
                data.euad2.height = formData.euad2.height;
                data.euad2.weight = formData.euad2.weight;
                data.euad2.bmi = formData.euad2.bmi;
                data.euad2.physclExamFlag1 = formData.euad2.physclExamFlag1;
                data.euafs = formData.euafs;
                //data.cusf01List = formData.cusf01List;
            }
            if(this.$refs.imFinance != undefined){
                let formData =  this.$refs.imFinance.getInsureData();
                data.cusf06List = formData.cusf06List;
                data.fnncllnfrm = formData.fnncllnfrm;
                data.euaa.inAnne = formData.euaa.inAnne;
                data.euaa.ownerAnne = formData.euaa.ownerAnne;
            }
            if(this.$refs.imInsureEx != undefined){
                let formData =  this.$refs.imInsureEx.getInsureData();
                data.cusf05List = formData.cusf05List;
                data.insurexprn = formData.insurexprn;
                data.euad2.sumasind = formData.euad2.sumasind;
                data.euad2.sumins01 = formData.euad2.sumins01;
                data.euad2.sumins02 = formData.euad2.sumins02;
                data.euad2.stdflag = formData.euad2.stdflag;
            }
            if(this.$refs.imSalesman != undefined){
                let formData =  this.$refs.imSalesman.getInsureData();
                data.euaa.cntbranch = formData.euaa.cntbranch;
                data.euaa.zrsecno01 = formData.euaa.zrsecno01;
                data.euaa.agntname01 = formData.euaa.agntname01;
                data.euaa.agtydesc01 = formData.euaa.agtydesc01;
                data.euaa.sign = formData.euaa.sign;
                data.euaa.agcomrt01 = formData.euaa.agcomrt01;
                data.euaa.zrsecno02 = formData.euaa.zrsecno02;
                data.euaa.agntname02 = formData.euaa.agntname02;
                data.euaa.agtydesc02 = formData.euaa.agtydesc02;
                data.euaa.tsign = formData.euaa.tsign;
                data.euaa.agcomrt02 = formData.euaa.agcomrt02;
                data.agentmatter = formData.agentmatter;
            }
            if(this.$refs.imInsuranceExa != undefined){
                let formData =  this.$refs.imInsuranceExa.getInsureData();
                data.applctnexam = formData.applctnexam;
                data.euaa.exreport = formData.euaa.exreport;
                data.euaa.bankbook = formData.euaa.bankbook;
                data.euaa.excpflg = formData.euaa.excpflg;
                data.euaa.flag09 = formData.euaa.flag09;
                data.euaa.omitsel = formData.euaa.omitsel;
                data.euaa.ismod = formData.euaa.ismod;
                data.euaa.errflg = formData.euaa.errflg;
                data.euaa.docstat = formData.euaa.docstat;
                data.euaa.fmlyreln = formData.euaa.fmlyreln;
            }
            if(this.$refs.imAnnexEx != undefined){
                let formData =  this.$refs.imAnnexEx.getInsureData();
                data.annexexam = formData.annexexam;
                data.euaa.proposal = formData.euaa.proposal;
                data.euaa.flag14 = formData.euaa.flag14;
                //data.euaes = formData.euaes;
            }
            if(this.$refs.imAntiMoneyEx != undefined){
                let formData =  this.$refs.imAntiMoneyEx.getInsureData();
                data.antimoney = formData.antimoney;
            }
            if(this.$refs.imOtherEx != undefined){
                let formData =  this.$refs.imOtherEx.getInsureData();
                data.otherexam = formData.otherexam;
                data.euaa.flag04 = formData.euaa.flag04;
            }
            if(this.$refs.imCursorEx != undefined){
               let formData =  this.$refs.imCursorEx.getInsureData();
               //data.cusf04List = formData.cusf04List;
               //data.cusf08List = formData.cusf08List;
               data.cusf03List = formData.cusf03List;
               //data.cusf02List = formData.cusf02List;
               //data.cusf07List = formData.cusf07List;
            }
            /**if(this.$refs.imAccount != undefined){
                let formData =  this.$refs.imAccount.getInsureData();
                data.zbxtpf = formData.zbxtpf;
            }**/
            console.info("从子组件得到组装数据",data)
            return data;
        },
        changeBillchnl(val){
            if(this.$refs.imCertificate != undefined){
                this.$refs.imCertificate.changeBillchnl(val);
            }
        },
        changeFmlyreln(val){
            if(this.$refs.imHealth != undefined){
                this.$refs.imHealth.setwhDisabled(val);
            }
        },
        changeEuabs(euabStrs){
            if(this.$refs.imInsureConLife != undefined){
                this.$refs.imInsureConLife.changeEuabs(euabStrs);
            }
            if(this.$refs.imInsureConAccident != undefined){
                this.$refs.imInsureConAccident.changeEuabs(euabStrs);
            }
            if(this.$refs.imInsureConInvest != undefined){
                this.$refs.imInsureConInvest.changeEuabs(euabStrs);
            }
        },
        asWnotnumConsole(){
            if(this.euaa.flag10 == 'A'){
                this.$message({
                    message: '该单为autopayout件，不可修改送金单!!!!',
                    type: 'error'
                });
                return false;
            }
            this.wnotnumDialogVisible = true;
        },
        checkFlag10(){
            if(this.euaa.flag10 == 'A' && this.euaa.asWnotnum != ''){
                this.euaa.flag10 = '';
                this.$message({
                    message: '有发票号码，首期缴费方式,应为 (C、M、P) !!',
                    type: 'error'
                });
                return false;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let para = {
                applnum: this.euaa.applnum,
                flag10: this.euaa.flag10,
                wnotnum: this.euaa.asWnotnum,
                billchnl: this.euaa.billchnl
            };
            checkFlag10(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euaa_flag10 != undefined){
                            this.euaa.flag10 = data.euaa_flag10;
                        }
                        if(data.euaa_asWnotnum_readonly != undefined){
                            this.euaa_asWnotnum_readonly = data.euaa_asWnotnum_readonly;
                        }
                        if(data.euaa_billchnl != undefined){
                            this.changeBillchnl(data.euaa_billchnl);
                        }
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        fun_checkWnotnum(index,row){
            for(let i = 0 ; i < this.eucas.length ; i++){
                if(index != i){
                    if(row.wnotnum ==  this.eucas[i].wnotnum){
                        row.wnotnum = '';
                        this.$message({
                            message: '凭证号码不能重复!',
                            type: 'error'
                        });
                        return false;
                    }
                }
            }
            let formData = this.getChildrenData();
            let para = {euaaVO: formData.euaa,asWnotnum: row.wnotnum};
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            checkWnotnum(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    let data = res.data;
                    if(data.eucapkyForm_wnotnum != undefined){
                        row.wnotnum = data.eucapkyForm_wnotnum;
                    }
                    if(data.euaaVO != undefined){
                        this.insureData.euaa = data.euaaVO;
                        this.loadChildrenData();
                    }
                    if(data.info != undefined){
                        this.$message({
                            message: data.info,
                            type: 'error'
                        });
                    }
                    if(data.message != undefined){
                        this.$alert(data.message, '提示', {
                            confirmButtonText: '确定',
                       });
                    }
                }
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        reWnotnumAfter(){
            for(let i = 0 ; i < this.eucas.length; i++){
                let wnotnum = this.eucas[i].wnotnum;
                if(!wnotnum){
                    this.$message({
                        message: '凭证号码不能为空!',
                        type: 'error'
                    });
                    return false;
                }
            }
            if(this.eucas != null && this.eucas.length > 0){
                this.euaa.asWnotnum = this.eucas[0].wnotnum;
            }else{
                this.euaa.asWnotnum = "";
            }
            let formData = this.getChildrenData();
            let para = {eucapfList: formData.eucas};
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            reWnotnumAfter(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    let data = res.data;
                    if(data.euaapkyForm_instPrem02 != undefined){
                        formData.euaa.instPrem02 = data.euaapkyForm_instPrem02;
                        this.insureData = formData;
                        this.loadChildrenData();
                        this.wnotnumDialogVisible = false;
                    }
                    if(data.info != undefined){
                        this.$message({
                            message: data.info,
                            type: 'error'
                        });
                    }
                }
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        checkSrcebus(){
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let para = {
                srcebus: this.euaa.srcebus,
                asCampaign1: this.euaa.asCampaign1,
                asCampaign2: this.euaa.asCampaign2
            };
            checkSrcebus(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euaapkyForm_srcebus != undefined){
                            this.euaa.srcebus = data.euaapkyForm_srcebus;
                        }
                        if(data.euaapkyForm_asSrc != undefined){
                            this.euaa.asSrc = data.euaapkyForm_asSrc;
                        }
                        if(data.euaapkyForm_asCampaign2 != undefined){
                            this.asCampaign2 = data.euaapkyForm_asCampaign2;
                        }
                        if(data.euaapkyForm_asCampaign1 != undefined){
                            this.asCampaign1 = data.euaapkyForm_asCampaign1;
                        }
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        fun_checkCampaign1(){
            if(this.euaa.asCampaign2 != ''){
                this.$message({
                    message: 'Compaigm Code与集汇件号栏位不可同时录入数值!',
                    type: 'error'
                });
                this.euaa.asCampaign1 = '';
                return ;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let para = {
                asWnotnum: this.euaa.asWnotnum,
                asCampaign1: this.euaa.asCampaign1,
                asEibgrpname: this.euaa.asEibgrpname
            };
            checkAsCampaign1(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euaapkyForm_asCampaign1 != undefined){
                            this.euaa.asCampaign1 = data.euaapkyForm_asCampaign1;
                        }
                        if(data.euaapkyForm_longdescc != undefined){
                            this.euaa.longdescc = data.euaapkyForm_longdescc;
                        }
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        fun_checkCampaign2(){
            if(this.euaa.asCampaign1 != ''){
                this.$message({
                    message: 'Compaigm Code与集汇件号栏位不可同时录入数值!',
                    type: 'error'
                });
                this.euaa.asCampaign2 = '';
                return ;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let para = {
                srcebus: this.euaa.srcebus,
                asCampaign1: this.euaa.asCampaign1,
                asCampaign2: this.euaa.asCampaign2
            };
            checkAsCampaign2(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euaapkyForm_asCampaign2 != undefined){
                            this.euaa.asCampaign2 = data.euaapkyForm_asCampaign2;
                        }
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        checkAsHprrcvdt(){
            let hprrcvdt = this.euaa.hprrcvdt.toString();
            if(hprrcvdt.length != 8){
                this.$message({
                    message: '日期长度不对!!',
                    type: 'error'
                });
                this.euaa.hprrcvdt = 0;
                this.$refs.hprrcvdt.focus();
                return false;
            }
            if(hprrcvdt != 0 && !hprrcvdt.match( /\d{8}$/)){
                this.$message({
                    message: '日期格式不对!!',
                    type: 'error'
                });
                this.euaa.hprrcvdt = 0;
                this.$refs.hprrcvdt.focus();
                return false;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let formData = this.getChildrenData();
            let para = {
                euaa: formData.euaa,
                euabs: formData.euabs
            };
            checkAsHprrcvdt(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euaapkyForm_asHprrcvdt != undefined){
                            this.euaa.hprrcvdt = data.euaapkyForm_asHprrcvdt;
                            if(this.euaa.hprrcvdt == '0'){
                                this.$refs.hprrcvdt.focus();
                            }
                        }
                        if(data.euaapkyForm_asAppldate != undefined){
                            this.euaa.appldate = data.euaapkyForm_asAppldate;
                        }
                        if(data.euaapkyForm_caldate != undefined){
                            this.euaa.caldate = data.euaapkyForm_caldate;
                        }
                        if(data.euaapkyForm_asEffdate != undefined){
                            this.euaa.effdate = data.euaapkyForm_asEffdate;
                        }
                        if(data.euaapkyForm_nextbdate != undefined){
                            this.euaa.nextbdate = data.euaapkyForm_nextbdate;
                        }
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                        }
                        formData.euaa = this.euaa;
                        this.insureDataForm = formData;
                        this.loadChildrenData();
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        selectPolplnTab(){
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let formData = this.getChildrenData();
            let para = {
                euaa: this.euaa,
                euad1: formData.euad1,
                euad2: formData.euad2,
                euabs: formData.euabs,
                // 第二被保人需求
                euad3: formData.euad3
            };
            selectPolplnTab(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euadpky2Form_cltdob != undefined){
                            formData.euad2.cltdob = data.euadpky2Form_cltdob;
                        }
                        if(data.euaapkyForm_appldate != undefined){
                            this.euaa.appldate = data.euaapkyForm_appldate;
                            formData.euaa.appldate = data.euaapkyForm_appldate;
                        }
                        if(data.euaapkyForm_caldate != undefined){
                            this.euaa.caldate = data.euaapkyForm_caldate;
                            formData.euaa.caldate = data.euaapkyForm_caldate;
                        }
                        if(data.euaapkyForm_caldate_readonly != undefined){
                            this.euaa.isCaldateRead =  data.euaapkyForm_caldate_readonly;
                            formData.euaa.isCaldateRead =  data.euaapkyForm_caldate_readonly;
                        }
                        if(data.euaapkyForm_nextbdate != undefined){
                            this.euaa.nextbdate = data.euaapkyForm_nextbdate;
                            formData.euaa.nextbdate = data.euaapkyForm_nextbdate;
                        }
                        if(data.euaapkyForm_firstpremTotal != undefined){
                            this.euaa.firstpremTotal = data.euaapkyForm_firstpremTotal;
                            formData.euaa.firstpremTotal = data.euaapkyForm_firstpremTotal;
                        }

                        if(data.euadpky1VO != undefined){
                            formData.euad1 = data.euadpky1VO;
                        }
                        if(data.euadpky2VO != undefined){
                            formData.euad2 = data.euadpky2VO;
                        }
                        // 第二被保人需求
                        if(data.euadpky3VO != undefined){
                          formData.euad3 = data.euadpky3VO;
                        }
                        if(data.euabpkyList != undefined){
                            formData.euabs = data.euabpkyList;
                        }
                        this.insureDataForm = formData;
                        this.loadChildrenData();
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                            return false;
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        selectionChanging(tab, event){
            if(this.flag == 'N'){
                return;
            }
            if(tab.name == '2'){
                this.selectPolplnTab();
            }
        },
        checkAsAppldate(){
            let appldate = this.euaa.appldate.toString();
            if(appldate.length != 8){
                this.$message({
                    message: '日期长度不对!!',
                    type: 'error'
                });
                this.euaa.appldate = 0;
                this.$refs.appldate.focus();
                return false;
            }
            if(appldate != 0 && !appldate.match( /\d{8}$/)){
                this.$message({
                    message: '日期格式不对!!',
                    type: 'error'
                });
                this.euaa.appldate = 0;
                this.$refs.appldate.focus();
                return false;
            }
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let formData = this.getChildrenData();
            let para = {
                euaa: this.euaa,
                euad1: formData.euad1,
                euad2: formData.euad2,
                euabs: formData.euabs
            };
            checkAsAppldate(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euadpky2Form_cltdob != undefined){
                            formData.euad2.cltdob = data.euadpky2Form_cltdob;
                        }
                        if(data.euaapkyForm_appldate != undefined){
                            this.euaa.appldate = data.euaapkyForm_appldate;
                            if(this.euaa.appldate == '0'){
                                this.$refs.appldate.focus();
                            }
                        }
                        if(data.euaapkyForm_caldate != undefined){
                            this.euaa.caldate = data.euaapkyForm_caldate;
                            formData.euaa.caldate = data.euaapkyForm_caldate;
                        }
                        if(data.euaapkyForm_caldate_readonly != undefined){
                            this.euaa.isCaldateRead =  data.euaapkyForm_caldate_readonly;
                            formData.euaa.isCaldateRead =  data.euaapkyForm_caldate_readonly;
                        }
                        if(data.euaapkyForm_nextbdate != undefined){
                            this.euaa.nextbdate = data.euaapkyForm_nextbdate;
                            formData.euaa.nextbdate = data.euaapkyForm_nextbdate;
                        }
                        if(data.euaapkyForm_firstpremTotal != undefined){
                            this.euaa.firstpremTotal = data.euaapkyForm_firstpremTotal;
                            formData.euaa.firstpremTotal = data.euaapkyForm_firstpremTotal;
                        }
                        if(data.euadpky1VO != undefined){
                            formData.euad1 = data.euadpky1VO;
                        }
                        if(data.euadpky2VO != undefined){
                            formData.euad2 = data.euadpky2VO;
                        }
                        if(data.euabpkyList != undefined){
                            formData.euabs = data.euabpkyList;
                        }
                        this.insureDataForm = formData;
                        this.loadChildrenData();
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                            return false;
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        checkAsWnotnum(){
            let asWnotnum = this.euaa.asWnotnum ;
            if(asWnotnum != '' && asWnotnum.length != 9){
                this.$message({
                    message: '送金单号码为 9 码, 请输入!!',
                    type: 'error'
                });
                this.euaa.asWnotnum = '';
                return ;
            }
            if(asWnotnum == ''){
                return ;
            }
            let euca = {
                "applnum": "","wnotnum": asWnotnum,
                "crtuser": "","dtecrt": ""
            }
            this.eucas.push(euca);
            this.fun_checkWnotnum(this.eucas.length-1,euca);
        },
        checkAsEibgrpnum(){
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            let para = {
                asWnotnum: this.euaa.asWnotnum,
                euad1: this.euaa.euad1,
                asCampaign1: this.euaa.asCampaign1,
                asEibgrpnum: this.euaa.asEibgrpnum
            };
            checkAsEibgrpnum(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    let data = res.data;
                    if(data != null){
                        if(data.euaapkyForm_asEibgrpnum != undefined){
                            this.euaa.asEibgrpnum = data.euaapkyForm_asEibgrpnum;
                        }
                        if(data.euaapkyForm_asEibgrpname != undefined){
                            this.euaa.asEibgrpname = data.euaapkyForm_asEibgrpname;
                        }
                        if(data.info != undefined){
                            this.$message({
                                message: data.info,
                                type: 'error'
                            });
                        }
                    }
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            })
        },
        async checkBackList(){//核保前检查黑名单
            let formData = this.getChildrenData();
            //投保人
            let ls_surname = formData.euad1.surname;
            let ls_passport = formData.euad1.secuityno;
            let ls_fmlyreln = formData.euad1.fmlyreln;
            let ls_anbAtCcd2 = formData.euad1.cltdob;
            let ls_ispltc = 'N';     		//'Y'属于政要人物  'N'不属于政要人物
            let ls_ispltc_statuz = '****';     //'****'处理正确，否则，处理出错
            let params = {surname:ls_surname,secuityno:ls_passport,anbAtCcd2:ls_anbAtCcd2};
            let res = await callPrcCHKPLTC(params);
            console.info("投保人政要人物检测",res);
            ls_ispltc_statuz = res.data.ispltcStatuz;
            //ls_ispltc = res.data.ispltc;
            formData.otherexam.applInGover = res.data.ispltc;
            //document.getElementById("scf1pkyForm.ind76").value=ls_ispltc;
            //被保人
            let ls_surname02 = formData.euad2.surname;
            let ls_passport02 = formData.euad2.secuityno;
            let ls_anbAtCcd202 = formData.euad2.cltdob;
            ls_ispltc = 'N' ;    		//'Y'属于政要人物  'N'不属于政要人物
            //ls_ispltc_statuz = '****';     //'****'处理正确，否则，处理出错
            console.info('ls_fmlyreln',ls_fmlyreln)
            if(ls_fmlyreln != 1){
                  params = {surname:ls_surname02,secuityno:ls_passport02,anbAtCcd2:ls_anbAtCcd202};
                  res = await callPrcCHKPLTC(params);
                 console.info("被保人政要人物检测",res);
                 ls_ispltc_statuz = res.data.ispltcStatuz;
                 //ls_ispltc = res.data.ispltc;
                 formData.otherexam.insuInGover = res.data.ispltc;
            }
            //document.getElementById("scf1pkyForm.ind77").value=ls_ispltc;
            //受益人
            ls_ispltc = 'N';
            let euaes = formData.euaes;
            console.info("受益人checkBackList",euaes);
            for(let i = 0; i < euaes.length-1; i++){
                ls_surname = euaes[i].surname;
                ls_passport = euaes[i].secuityno;
                ls_anbAtCcd2= euaes[i].cltdob;
                params = {surname:ls_surname,secuityno:ls_passport,anbAtCcd2:ls_anbAtCcd2};
                res = await callPrcCHKPLTC(params);
                console.info("受益人政要人物检测",res);
                ls_ispltc_statuz = res.data.ispltcStatuz;
                ls_ispltc = res.data.ispltc;
                if (ls_ispltc == 'Y'){
                    break;
                }
            }
            formData.otherexam.bnyInGover = ls_ispltc;
            this.insureData = formData;
            this.loadChildrenData();
		    //document.getElementById("scf1pkyForm.ind78").value=ls_ispltc;
        },
        async checkDoubtList(){//核保前检查可疑名单
            let formData = this.getChildrenData();
            let clntnum_1 = formData.euad1.clntnum;
            let fmlyreln = formData.euad1.fmlyreln;
            let clntnum_2 = formData.euad1.clntnum;
            let euaepfArray = [];
            for(let i = 0 ; i < formData.euaes.length ; i++){
                euaepfArray.push(formData.euaes[i].bnyclt);
            }
            let params = {clntnum_1:clntnum_1,clntnum_2:clntnum_2,
                        fmlyreln:fmlyreln,euaepfArray:euaepfArray};
            let res = await checkDoubtList(params);
            console.info("核保前检查可疑名单",res);
            if(res.data.info != undefined){
                this.$message({
                    message: res.data.info,
                    type: 'error'
                });
            }
            if(res.data.list!= undefined){
                this.blacklist = res.data.list;
                this.blacklistDialogVisible = true;
                //document.getElementById("scf1pkyForm.ind58").value=result;
			    //document.getElementById("scf1pkyForm.ind59").value=result;
			    //document.getElementById("scf1pkyForm.ind60").value=result;
            }
            return this.blacklistDialogVisible ;
        },
        showOpinionTable() { // 显示核保意见分页弹框
            console.log('点击了核保意见！');
            const params = {
                applnum: this.euaa.applnum,
                pageNumber: this.paginations_O.pageIndex,
                pageSize: this.paginations_O.pageSize
            };
            this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
            getOpinionPage(params).then(res => {
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                if(res.resultCode == constant.SUCCESS){
                    if (res.data && res.data.rows) {
                        this.opinionData = res.data.rows;
                        this.paginations_O.total = res.data.total;
                    } else {
                        this.opinionData = [];
                        this.paginations_O.total = 0;
                    }
                    this.opinionDialogVisible = true;
                } else {
                    this.$message.error(res.resultMsg?res.resultMsg:'程序异常，请联系管理员！');
                }
            }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
            });
        },
        // 核保意见弹框-上下页
        handleCurrentChange_O(page) {
            this.paginations_O.pageIndex = page;
            this.showOpinionTable();
        },
        // 核保意见弹框-每页多少条切换
        handleSizeChange_O(pageSize) {
            this.paginations_O.pageSize = pageSize;
            this.showOpinionTable();
        },
        // 核保意见弹框-关闭弹框
        opinionBlank() {
            this.opinionDialogVisible = false;
			this.showOpinion = false;
			this.bmntdesc = '';
        }
    },
    watch:{
        $route(to,from){
            // 关闭详情 则初始化显示
            // debugger
            // console.log(to);
            // console.log(from);
            if(to.fullPath.indexOf('fileInfolMaintain') > 0 && from.fullPath.indexOf('customerNo') > 0){
                this.$emit('isSubClose',0);
                this.isPopHide = true;
            } else if(to.fullPath.indexOf('customerNo') < 0){
                this.$emit('isSubClose',1);
            } else {
                this.$emit('isSubClose',0);
            }
        }
    }
}
</script>

<style lang="less" scoped>
.fillcontain{
    padding:20px 20px 20px 20px;
    .fixd_botton_box{
        position: fixed;
        right: 0px;
        top: 60%;
        width: 64px;
        height: auto;
        .fixd_botton{
            border-radius: 4px;
            background-color: #999999;
            cursor: pointer;
            height: 24px;
            width: 24px;
            display: block;
            padding: 8px;
        }
    }
}
</style>
